package com.yifushidai.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "tb_open")
@ApiModel(value = "开门记录")
public class OpenRecordEntity {
    @ApiModelProperty(value = "自动编号")
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @ApiModelProperty(value = "联网mac")
    private String mac;

    @ApiModelProperty(value = "开门结果(0成功 1失败)")
    private Integer result;

    @ApiModelProperty(value = "开门类型(TK临时密码 FK固定密码 C0卡开门")
    private String typ;

    @ApiModelProperty(value = "标记：固定密码、临时密码或IC卡号")
    private String mark;

    @ApiModelProperty(value = "开门时间")
    @Column(name = "open_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date openTime;
}